<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Payment
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: Filter.php 8292 2011-01-25 00:21:31Z john $
 * @author     John Boehr <j@webligo.com>
 */

/**
 * @category   Application_Core
 * @package    Payment
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Payment_Form_Admin_Package_Filter extends Engine_Form {
	public function init() {
		$this->clearDecorators ()->addDecorator ( 'FormElements' )->addDecorator ( 'Form' )->addDecorator ( 'HtmlTag', array ('tag' => 'div', 'class' => 'search' ) )->addDecorator ( 'HtmlTag2', array ('tag' => 'div', 'class' => 'clear' ) );
		
		$this->setAttribs ( array ('id' => 'filter_form', 'class' => 'global_form_box' ) )->setMethod ( 'GET' );
		
		// Element: query
		$this->addElement ( 'Text', 'query', array ('label' => 'Search', 'decorators' => array ('ViewHelper', array ('Label', array ('tag' => null, 'placement' => 'PREPEND' ) ), array ('HtmlTag', array ('tag' => 'div' ) ) ) ) );
		
		// Element: level_id
		$levels = Engine_Api::_ ()->getDbtable ( 'levels', 'authorization' )->select ()->from ( 'engine4_authorization_levels', array ('level_id', 'title' ) )->order ( 'level_id ASC' )->query ()->fetchAll ();
		$multiOptions = array ('' => '' );
		foreach ( $levels as $level ) {
			$multiOptions [$level ['level_id']] = $level ['title'];
		}
		$this->addElement ( 'Select', 'level_id', array ('label' => 'Member Level', 'multiOptions' => $multiOptions ) );
		
		// Element: enabled
		$this->addElement ( 'Select', 'enabled', array ('label' => 'Enabled', 'multiOptions' => array ('' => '', '1' => 'Yes', '0' => 'No' ), 'decorators' => array ('ViewHelper', array ('Label', array ('tag' => null, 'placement' => 'PREPEND' ) ), array ('HtmlTag', array ('tag' => 'div' ) ) ) ) );
		
		// Element: signup
		$this->addElement ( 'Select', 'signup', array ('label' => 'Signup', 'multiOptions' => array ('' => '', '1' => 'Yes', '0' => 'No' ), 'decorators' => array ('ViewHelper', array ('Label', array ('tag' => null, 'placement' => 'PREPEND' ) ), array ('HtmlTag', array ('tag' => 'div' ) ) ) ) );
		
		// Element: order
		$this->addElement ( 'Hidden', 'order', array ('order' => 10004 ) );
		
		// Element: direction
		$this->addElement ( 'Hidden', 'direction', array ('order' => 10005 ) );
		
		// Element: execute
		$this->addElement ( 'Button', 'execute', array ('label' => 'Search', 'type' => 'submit', 'decorators' => array ('ViewHelper', array ('HtmlTag', array ('tag' => 'div', 'class' => 'buttons' ) ), array ('HtmlTag2', array ('tag' => 'div' ) ) ) ) );
	}
}